import { Component, Input, OnInit } from '@angular/core'
import dayGridPlugin from '@fullcalendar/daygrid'
import { ButtonTextCompoundInput } from '@fullcalendar/core/types/input-types'
@Component({
  selector: 'app-calendar',
  templateUrl: './calendar.component.html',
  styleUrls: ['./calendar.component.css']
})
export class CalendarComponent implements OnInit {
  public calendarPlugins = [dayGridPlugin]
  @Input() hdata10: any // 接收父组件传递的高度值
  @Input() wdata10: any
  date = new Date()
  d = this.date.getDate()
  m = this.date.getMonth()
  y = this.date.getFullYear()

  task = [
    {
      title: '全天计划\r\n#####\r\n写代码',
      color: '#a0d468',
      textColor: '#FFFFFF',
      start: new Date(this.y, this.m, 1)
    },
    {
      title: '张家界四日游',
      color: '#ffce55',
      textColor: '#FFFFFF',
      start: new Date(this.y, this.m, this.d - 5),
      end: new Date(this.y, this.m, this.d - 2)
    },
    {
      id: 999,
      title: '电话回访客户',
      color: '#fb6e52',
      textColor: '#FFFFFF',
      start: new Date(this.y, this.m, this.d - 6, 16, 0),
      allDay: false
    },
    {
      id: 999,
      title: '电话回访客户',
      color: '#fb6e52',
      textColor: '#FFFFFF',
      start: new Date(this.y, this.m, this.d + 4, 16, 0),
      allDay: false
    },
    {
      title: '视频会议',
      color: '#fb6e52',
      textColor: '#FFFFFF',
      start: new Date(this.y, this.m, this.d, 10, 30),
      allDay: false
    },
    {
      title: '中秋放假',
      start: '2019-09-19',
      end: '2019-09-21'
    },
    {
      title: '午饭',
      color: '#a0d468',
      textColor: '#FFFFFF',
      start: new Date(this.y, this.m, this.d, 12, 0),
      end: new Date(this.y, this.m, this.d, 14, 0),
      allDay: false
    }
  ]

  public calendarButtons: ButtonTextCompoundInput = {
    today: '今天',
    month: '月',
    week: '周',
    day: '日'
  }

  constructor() {}

  ngOnInit() {}
}
